package com.web;

import org.jetbrains.annotations.NotNull;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

@Component
public final class SystemConfig implements EnvironmentAware {
    private static Environment environment;

    private SystemConfig() {
        //
    }

    @Override
    public void setEnvironment(@NotNull Environment environment) {
        SystemConfig.environment = environment;
    }

    public static String getProperty(String key) {
        return SystemConfig.environment.getProperty(key);
    }
}
